#include "function.h"

using namespace std;

int main(void)
{
    int select = 0;

    addressbook abs;
    abs.size = 0;

    showmenu();

    while(1)
    {
        cin >> select;
        switch(select)
        {
        case 1:
            addperson(&abs);
            clear();
            break;
        case 2:
            showperson(&abs);
            clear();
            break;
        case 3:
            deleteperson(&abs);
            clear();
            break;
        case 4:
            findperson(&abs);
            clear();
            break;
        case 5:
            changeperson(&abs);
            clear();
            break;
        case 6:
            cleanperson(&abs);
            clear();
            break;
        case 0:
            cout << "欢迎下次使用" << endl;
            return 0;
            break;
        default:
            break;
        }
    }

    return 0;
}